<template>
	<view class="body p30">
		<view class="bg-white p20 br32 section" v-if="list.length > 0">
			<!-- <view class="order-item pt35 pb35 line" @click="jump(`/pages/order/detail?id=${item.id}`)" v-for="(item, index) in list" :key="index">
				<view class="order-header d-b-c f28 mb15">
					<view class="order-id">订单号: {{ item.id }}</view>
					<view class="order-status green fb">{{ item.status }}</view>
				</view>
				<view class="order-program f32 mb15 fb">{{ item.courseName }}</view>
				<view class="order-id d-s-c mb30">
					<i class="iconfont icon-xiaoren mr15"></i>
					学员:{{ item.studentName }}
				</view>
				<view class="order-footer d-b-c">
					<view class="order-date">{{ item.time }}</view>
					<view class="order-price fb red f36">¥{{ item.totalPrice }}</view>
				</view>
			</view> -->
			<orderItem v-for="(item, index) in list" :key="index" :item='item'></orderItem>
		</view>
		<u-empty mode="list" v-else marginTop="30vh"></u-empty>
		<tabbar :active="3"></tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		onLoad() {
			this.getList();
		},
		methods: {
			async getList() {
				const res = await this.$request({
					url: this.$api.getListAll,
					data: {
						parentId: uni.getStorageSync('user').id || false
					}
				});
				this.list = res;
			}
		}
	};
</script>

<style scoped lang="scss">
	.order-id {
		color: #7f8c8d;

		i {
			color: #3498db;
		}
	}

	.order-program {
		color: #2c3e50;
	}

	.section {
		box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
	}
</style>
